var e = getApp();

Page({
    data: {
        value: "",
        express_info: [],
        company_name: "",
        express_sn: "",
        thumb: "",
        tel: "",
        status_name: "",
        api: "",
        id: "",
        order_express_id: "",
        for_goods: !1
    },
    onLoad: function(e) {
        console.log(e), e.fromGrab && 1 == e.fromGrab ? e.api && this.setData({
            api: e.api
        }) : e.api ? this.setData({
            api: e.api
        }) : this.setData({
            api: "dispatch.express"
        }), e.id && this.setData({
            id: e.id
        }), e.order_express_id && this.setData({
            order_express_id: e.order_express_id
        }), this.getExpress();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    cutPackage: function(e) {
        var s = e.currentTarget.dataset.item;
        console.log(s, "ddd"), this.setData({
            order_express_id: s
        }), this.getExpress();
    },
    getExpress: function() {
        var s = this, t = this, a = e.getNetAddresss(t.data.api), r = {
            order_id: this.data.id,
            order_express_id: this.data.order_express_id
        };
        this.options.from && "userReturn" == this.options.from ? (delete r.order_id, delete r.order_express_id, 
        r.refund_id = this.options.refund_id, a = e.getNetAddresss("refund.express.user-return")) : this.options.from && "resend" == this.options.from && (delete r.order_id, 
        delete r.order_express_id, r.refund_id = this.options.refund_id, r.express_id = this.options.express_id, 
        a = e.getNetAddresss("refund.express.resend")), e._getNetWork({
            url: a,
            data: r,
            success: function(a) {
                var r, o = a.data;
                1 == o.result ? ("dispatch.express" == s.data.api ? (r = o.data.data, s.setData({
                    for_goods: o.data.for_goods,
                    packageList: o.data.package
                })) : r = o.data, t.setData({
                    company_name: r.company_name,
                    express_sn: r.express_sn,
                    express_info: r.data || [],
                    tel: r.tel,
                    status_name: r.status_name,
                    thumb: r.thumb
                })) : e.tips(o.msg);
            },
            fail: function(e) {}
        });
    },
    copyorderbtn: function(e) {
        var s = e.currentTarget.dataset.copydata;
        s && wx.setClipboardData({
            data: s || "",
            success: function(e) {
                wx.showToast({
                    icon: "none",
                    title: "复制成功",
                    duration: 1e3
                });
            }
        });
    }
});